package com.miniot.pest.controller;

import com.miniot.business.base.BaseController;
import com.miniot.business.base.R;
import com.miniot.pest.dto.*;
import com.miniot.pest.service.VsualizationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("/vsualization" )
@Api(value = "可视化(后台)", tags = "可视化-后台接口")
public class VsualizationController extends BaseController {
    private final VsualizationService vsualizationService;
    /**
     * 设备列表
     * @return Result
     */
    @GetMapping("/getEquipment")
    @ApiOperation(value = "设备列表")
    public R<EquipmentDTO> getEquipment() {
        return R.success(vsualizationService.getEquipment(),"查询成功");
    }

    /**
     * 识别图片
     * @return Result
     */
    @GetMapping("/getDiscern")
    @ApiOperation(value = "识别图片")
    public R<DiscernDTO> getDiscern() {
        return R.success(vsualizationService.getDiscern(),"查询成功");
    }

    /**
     * 识别记录
     * @return Result
     */
    @GetMapping("/getRecord")
    @ApiOperation(value = "识别记录")
    public R<RecordDTO> getRecord() {
        return R.success(vsualizationService.getRecord(),"查询成功");
    }
    /**
     * 虫情统计
     * @return Result
     */
    @GetMapping("/getStatistics")
    @ApiOperation(value = "虫情统计")
    public R<StatisticsDTO> getStatistics() {
        return R.success(vsualizationService.getStatistics(),"查询成功");
    }
    /**
     * 虫情趋势分析
     * @return Result
     */
    @GetMapping("/getTrend")
    @ApiOperation(value = "虫情趋势分析")
    public R<TrendDTO> getTrend() {
        return R.success(vsualizationService.getTrend(),"查询成功");
    }
    /**
     * 杀虫数统计
     * @return Result
     */
    @GetMapping("/getKill")
    @ApiOperation(value = "杀虫数统计")
    public R<KillDTO> getKill() {
        return R.success(vsualizationService.getKill(),"查询成功");
    }
}
